from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action
from core.support import set_cutscene

class VideoCard(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # build list of actions
        self.add_action(East)
        self.add_action(West)
    
    # return description of room.
    def get_description(self):
        return '''
        You are in the video card. The screensaver has been activated due to the user's inactivity.
        '''
    
    # return image of room
    def get_image(self):
        return 'Screensaver.gif'
        #return 'ramram.png'
    
    def get_image_width(self):
        return 'width=555px;'

class VideoCardHandler(BaseHandler):
    
    def get_template(self):
        return 'cpu.html'
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return VideoCard

# define actions for this room

class East(Action):
    def __init__(self):
        Action.__init__(self, "East")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go East"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'busnodriver'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def post_method(self):
        return "get"

class West(Action):
    def __init__(self):
        Action.__init__(self, "West")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Move the mouse"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'Monitor'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
